#include "widget.h"
#include "ui_widget.h"
#include<QIcon>
#include<QCursor>
#include<QTextCursor>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QIcon i(":/111.jpg");
    this->setWindowIcon(i);
    this->setWindowIconText("狮山沃德");
    QCursor a(Qt::WaitCursor);
    this->setCursor(a);
    ui->pushButton->setShortcut(QKeySequence(Qt::Key_Left));

    ui->pushButton_2->setShortcut(QKeySequence(Qt::Key_Right));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    float a=this->windowOpacity();
    if(a>=1.0)
        return;
    a+=0.1;
    this->setWindowOpacity(a);
}

void Widget::on_pushButton_2_clicked()
{
    float a=this->windowOpacity();
    if(a<=0.0)
        return;
    a-=0.1;
    this->setWindowOpacity(a);
}
